-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HWKMETRICS-802] Validate when scheduled jobs has null values #1007
[HWKMETRICS-802] Validate when scheduled jobs has null values #1007
Conversation
17d7418
to
2831bab
Compare
"slice [%s]", jobId, timeSlice.getTime())); | ||
// First check if the job exists | ||
return session.executeAndFetch(findByIdAndSlice.bind(timeSlice, jobId)) | ||
.isEmpty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll comment on this PR as the other one were you presented the question was merged already. I'm not sure what you try to achieve here, since if the previous part does not emit anything, then there's nothing to flatMap in the next section either. So why transform the end event to a boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to validate if the findByIdAndSlice
statement returns empty, just for logging purposes. In the case of non-empty I will execute the updateStatus
statement, is in this case when I need to use flatMap.
Essentially I'm transforming a boolean to emitted rows from updateStatus only if the boolean true, otherwise, I'm returning an empty observable. I'm using the flatMap to flat the Observable returned by updateStatus.
Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.switchIfEmpty(Observable.empty().doOnComplete(() -> logger.info("Nothing was found!"))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mm yeah, something like that :)
f1ff9ed
to
03719e5
Compare
03719e5
to
b3d466e
Compare
* Validate when scheduled jobs has null values (#1007) * Release 0.28.8.Final
No description provided.